home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 12 / Amiga Plus Sonderheft Amiga 12.iso / rexx / breaktask.scout < prev    next >
Text File  |  1996-02-16  |  1KB  |  40 lines

  1. /**************************************************************************
  2.  *        This ARexx script sends a CTRL-C to the task <taskname>.        *
  3.  *                      USAGE: breaktask <taskname>                       *
  4.  **************************************************************************/
  5.  
  6. if showlist('p','SCOUT.1') < 1 then do
  7.   say "Scout is not running!"
  8.   exit
  9. end
  10. address 'SCOUT.1'
  11. parse arg taskname
  12.  
  13. options results
  14. options failat 20
  15.  
  16. if taskname = '' then do
  17.   say "usage: breaktask <taskname>"
  18.   exit
  19. end
  20.  
  21. FindTask taskname
  22. taskaddress = result
  23. if taskaddress = 'RESULT' then
  24.   say "Can't find task '" || taskname || "'!"
  25. else do
  26.   BreakTask taskname
  27.   say "CTRL-C sent..."
  28.   address command 'wait 1 sec'
  29.   FindTask taskname
  30.   taskaddress = result
  31.   if taskaddress = 'RESULT' then
  32.     do
  33.       say "... and task '" || taskname || "' is no longer in system!"
  34.       exit
  35.     end
  36.   else
  37.     say "... but task '" || taskname || "' (" || taskaddress || ") is still in system!"
  38. end
  39. exit
  40.